 
package marker.xml.metadata;

import java.util.List;

import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.ElementList;

 
public class Property {
	@Attribute
	private String name;
	@Attribute
	private String type;
	@Attribute(required=false)
	private String desc;
	@Attribute(required=false)
	private String refType;
	@ElementList(name="if",required=false,type=IfInfo.class)
	private List<IfInfo> ifConditions;
	
	private boolean isInIf;

	public List<IfInfo> getIfConditions() {
		return ifConditions;
	}

	public void setIfConditions(List<IfInfo> ifConditions) {
		this.ifConditions = ifConditions;
	}

	public String getName() {
		return name;
	}
	 
	public void setName(String name) {
		this.name = name;
	}
 
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getRefType() {
		return refType;
	}

	public void setRefType(String refType) {
		this.refType = refType;
	}

	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}
	
	public boolean isInIf() {
		return isInIf;
	}

	public void setInIf(boolean isInIf) {
		this.isInIf = isInIf;
	}

	@Override
	public int hashCode() {
		return this.name.hashCode();
	}

	
	@Override
	public boolean equals(Object obj) {
		if(obj instanceof Property){
			return name.endsWith(((Property)obj).name);
		}
		return super.equals(obj);
	}
	
	
	
}
